﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;

namespace Mvc.HtmlHelpers
{
    public class JsonData
    {
        public object jsonData { get; private set; }

        public JsonData()
        {
            var m_jsonData = new
            {
                total = 0,
                page = 0,
                records = 0,
                rows = ""
            };
            jsonData = m_jsonData;
        }

        public JsonData(int totalPages, int pageIndex, int totalRecords, object modelList)
        {
            var m_jsonData = new {
                total = totalPages,
                page = pageIndex,
                records = totalRecords,
                rows = modelList               
            };
            jsonData = m_jsonData;
        }
    }
}
